package ahblue.cn.tanzi.ui.person;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.TextView;

import ahblue.cn.tanzi.R;
import ahblue.cn.tanzi.model.user.LoginResultModel;
import ahblue.cn.tanzi.model.user.PackageModel;
import ahblue.cn.tanzi.ui.base.BaseActivity;
import ahblue.cn.tanzi.ui.person.pkg.AccountActivity;
import ahblue.cn.tanzi.ui.person.pkg.PutMoneyActivity;
import ahblue.cn.tanzi.ui.person.pkg.WellGotActivity;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * @author pink-jackstraw
 * @date 2018/11/10
 * @describe 我的钱包
 */
public class PackageActivity extends BaseActivity {

    @BindView(R.id.jine01)
    TextView jine01;
    @BindView(R.id.jine02)
    TextView jine02;
    @BindView(R.id.jine03)
    TextView jine03;
    public static void into(Activity activity) {
        activity.startActivity(new Intent(activity, PackageActivity.class));
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_package);
        ButterKnife.bind(this);
        PackageModel.getPayMoney(PackageActivity.this, LoginResultModel.getToken(this), new PackageModel.DataVertifyListener() {


            @Override
            public void conver(PackageModel data) {

                jine02.setText(data.freeze_amount);
                jine01.setText(data.member_deposit);
                jine03.setText(data.apply_amount);
            }
        });
    }

    @OnClick(R.id.btn_back)
    public void onViewClicked() {
        finish();
    }

    @OnClick({R.id.postmsg, R.id.mypost, R.id.quickly, R.id.businessmanage, R.id.refund,R.id.paylist})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.postmsg:
                PayMoneyActivity.into(this);
                break;
            case R.id.mypost:
                GetMoneyActivity.into(this);
                break;
            case R.id.quickly:
                WellGotActivity.into(this);
                break;
            case R.id.businessmanage:
                AccountActivity.into(this);
                break;
            case R.id.refund:
                PutMoneyActivity.into(this);
                break;
            case R.id.paylist:
//                PayListActivity.into(this);
                startActivity(new Intent(this,MyTeamActivity.class));
                break;
        }
    }
}
